Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add canonicalUrl to point to grafana.com/docs/k6 pages #1429

Merged
merged 17 commits into from
Dec 6, 2023

Conversation

heitortsergent
Copy link
Collaborator

@heitortsergent heitortsergent commented Nov 28, 2023

Update canonical URL for all the k6.io/docs pages to point to the grafana.com/docs/k6 version.

@heitortsergent heitortsergent marked this pull request as ready for review November 29, 2023 18:45
Copy link
Member

@jdbaldry jdbaldry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spotted some 404s:

src/data/markdown/translated-guides/en/02 Using k6/10 Protocols/04 SSL-TLS/Online Certificate Status Protocol -OCSP-.md:canonicalUrl: https://grafana.com/docs/k6/latest/using-k6/protocols/ssl-tls/online-certificate-status-protocol-ocsp/
404
--
src/data/markdown/translated-guides/en/06 Test Types/00 Load test types.md:# canonicalUrl: https://grafana.com/load-testing/load-testing-types/
404
--
src/data/markdown/docs/40 xk6-disruptor/01 Get started/04 Expose  Your Application.md:canonicalUrl: https://grafana.com/docs/k6/latest/testing-guides/injecting-faults-with-xk6-disruptor/expose-your-application/
404
--
src/data/markdown/docs/40 xk6-disruptor/02 Explanations/01 How  it works.md:canonicalUrl: https://grafana.com/docs/k6/latest/testing-guides/injecting-faults-with-xk6-disruptor/how-it-works/
404

Here are some also interesting canonicals that might need double checking. I considered them interesting if they didn't point to a https://grafana.com/docs/k6/latest/ or https://grafana.com/docs/grafana-cloud/k6/ page:

src/data/markdown/translated-guides/en/08 Misc/04 k6 REST API.md:canonicalUrl: https://grafana.com/docs/k6
src/data/markdown/translated-guides/en/02 Using k6/17 HTTP debugging.md:canonicalUrl: https://grafana.com/docs/k6
src/data/markdown/translated-guides/en/02 Using k6/20 Workaround Iteration Duration.md:canonicalUrl: https://grafana.com/docs/k6
src/data/markdown/translated-guides/en/02 Using k6/19 Javascript Compatibility Mode.md:canonicalUrl: https://grafana.com/docs/k6
src/data/markdown/translated-guides/en/06 Test Types/01 Smoke Testing.md:# canonicalUrl: https://grafana.com/
src/data/markdown/translated-guides/en/06 Test Types/02 Load Testing.md:# canonicalUrl: https://grafana.com/
src/data/markdown/translated-guides/en/06 Test Types/07-breakpoint-testing.md:# canonicalUrl: https://grafana.com/
src/data/markdown/translated-guides/en/06 Test Types/05 Soak Testing.md:# canonicalUrl: https://grafana.com/
src/data/markdown/translated-guides/en/06 Test Types/03 Stress testing.md:# canonicalUrl: https://grafana.com/
src/data/markdown/translated-guides/en/06 Test Types/00 Load test types.md:# canonicalUrl: https://grafana.com/load-testing/load-testing-types/
src/data/markdown/translated-guides/en/Test Types.md:# canonicalUrl: https://grafana.com/
src/data/markdown/translated-guides/en/07 Testing Guides/03 Load testing websites.md:# canonicalUrl: https://grafana.com/
src/data/markdown/translated-guides/en/07 Testing Guides/01 API load testing.md:canonicalUrl: https://grafana.com/docs/k6

Seven canonicals are https://grafana.com/ and five go to 5 https://grafana.com/docs/k6

Mostly looks good to me!

@jdbaldry
Copy link
Member

In case it's useful, the script I used was:

#!/usr/bin/env bash

IFS=$'\n'
for canonical in $(rg --no-heading canonicalUrl: src/data/markdown); do
  echo "${canonical}"
  url=${canonical##* }
  curl -Ls -o /dev/null -w '%{http_code}\n' "${url}"

  sleep 0.1
done

And then I put the output into a file called output.txt and ran some analysis on that file:

$ # Find 404s.
$ grep '^4..$' -B 1 output.txt
$ # Find all canonicals that look unusual
$ grep -vE '([0-9]{3}|https://grafana.com/docs/(grafana-cloud/|k6/latest/).*)$' output.txt
$ # Count repeated canonicals
$ grep -o -E 'https://.*$' output.txt | sort | uniq -c | grep -v 1

@heitortsergent
Copy link
Collaborator Author

Thanks @jdbaldry!

For the 404s you mentioned, I opened a PR on the website repo to fix 3 of them, and one is a commented-out URL.

For the other ones you found, a few of them are also set as comments until we have the new marketing pages up, and I removed a few of the canonicalUrl properties from pages that are just hidden from the sidebar. 🤓

Copy link
Member

@jdbaldry jdbaldry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for checking Heitor

@heitortsergent heitortsergent merged commit 5c78be1 into main Dec 6, 2023
5 checks passed
@heitortsergent heitortsergent deleted the docs-migration-canonical branch December 6, 2023 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants